import request from '@/utils/request'


// 查询出入库管理列表
export function listOpInfo(query) {
  return request({
    url: '/businessManagement/opInfo/list',
    method: 'get',
    params: query
  })
}
// 联表查询出入库管理列表
export function listOpInfoAndListInfo(query) {
  return request({
    url: '/businessManagement/opInfo/complexList',
    method: 'get',
    params: query
  })
}

// 查询出入库管理详细
export function getOpInfo(id) {
  return request({
    url: '/businessManagement/opInfo/' + id,
    method: 'get'
  })
}

// 新增出入库管理
export function addOpInfo(data) {
  return request({
    url: '/businessManagement/opInfo',
    method: 'post',
    data: data
  })
}

// 修改出入库管理
export function updateOpInfo(data) {
  return request({
    url: '/businessManagement/opInfo',
    method: 'put',
    data: data
  })
}

// 删除出入库管理
export function delOpInfo(id) {
  return request({
    url: '/businessManagement/opInfo/' + id,
    method: 'delete'
  })
}
//逻辑删除入库管理
export function delOpInfoLogical(id){
  return request({
    url:'/businessManagement/opInfo/delLogical/' + id,
    method:'put'
  })
}
// 根据入库单据id 查明细
export function getBillAndOpInfo(billId) {
  return request({
    url: '/businessManagement/opInfo/getBillAndOpInfo/' + billId,
    method: 'get'
  })
}